<?php require_once '../yubiphpbase/appinclude.php';
require_once '../yubiphpbase/yubi_lib.php';
include 'head.htm';
$otp = getHttpVal('otp', '');
if (strlen($otp) > 0) {
	$devId = substr($otp, 0, 12);
	$devId_b64 = modhexToB64($devId);
	echo '<h2>Your Yubikey token ID is:</h2><ul>'.
		'<li>modhex encoded: ' . $devId .
		'<li>base64 encoded: ' . $devId_b64 .
		'<li>hex encoded: ' . b64ToHex($devId_b64) . 
		"</ul>";
} else {
	echo '<h2>Yubikey Converter</h2>';
}
?>
<p><br>

<form action=converter.php method=post autocomplete=off>
<b>OTP:</b> <input name=otp value="" size=100 maxlength=100><p>
<input type=submit value="Get the token ID from your Yubikey">
</form>
